//
//  Analyzer.hpp
//  RoutingEvaluator
//
//  Created by Christopher Kemsley on 4/15/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#include <string>
#include <map>
#include <ostream>
#include <fstream>
#import "NodeInfo.hpp"
#import "LinkInfo.hpp"

#include "Node.hpp"
#include "Link.hpp"

#import "IAStateDefinitions.h"

#import "PropertySet.hpp"


NamespaceBegin



class	Analyzer ;
class	Output ;





class	Analyzer
{
public:
	
	static std::map<std::string,Analyzer*> const&	analyzers () ;
	static Analyzer*	analyzer ( std::string const& name ) ;
	
	
	virtual void	analyze		( NodeInfoSet * nodesInfo , LinkInfoSet * linksInfo , PropertySet const & info , Output & output ) = 0 ;
	
	
	
protected:
	Analyzer ( char const* name ) ;
	virtual ~Analyzer () ;
	
	
private:
	static std::map<std::string,Analyzer*>&	mAnalyzers () ;
} ;






class	Output
{
public:
	Output ( std::string const & basePath = "./Output" ) ;
	~Output () ;
	
	
	std::ostream&	logOut () ;
	std::ostream&	tableOut () ;
	
	void	drawNetworkTopology	( NodeSet * nodes , LinkVector const & links ) ;
	
	
#ifdef IAIsObjC
	void	log		( NSString * line ) ;
	void	log		( NSString * format , ... ) ;
#endif
	
	
private:
	std::string		mBasePath ;
	
	std::ofstream	mLogOut ;
	std::ofstream	mTableOut ;
} ;






NamespaceEnd
